package com.wsd.smartcarwasher.dao;

import com.wsd.smartcarwasher.domain.Partner;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;

import java.math.BigDecimal;
import java.util.List;

public interface PartnerDao {

    int addPartner(Partner partner) throws DataAccessException;
    List<Partner> queryDataPartner(String partnerId) throws DataAccessException;
    int deletePartner(int id) throws DataAccessException;

    int updatePartner(Partner partner) throws DataAccessException;

    List<Partner> queryAllPartner() throws DataAccessException;

    Partner hasPartnerWithCellphone(@Param("cellphone") String cellphone) throws DataAccessException;

    Partner getPartnerByOpenId(String openId) throws DataAccessException;

    Partner getPartnerByPhoneNumber(String cellphone) throws DataAccessException;

    Partner getPartnerByCellphone(String cellphone) throws DataAccessException;

    int setOpenIdOfPartner(@Param("id") int id, @Param("openId") String openId) throws DataAccessException;

    Partner getPartnerById(int id) throws DataAccessException;

    int changePartnerAccountAndProfit(@Param("account") BigDecimal account,
                                      @Param("profit") BigDecimal profit,
                                      @Param("partnerId") int partnerId) throws DataAccessException;


    List<Partner> queryAllPartnerCount() throws DataAccessException;

    int deletePartnerOpemId() throws DataAccessException;
}
